package com.bjpn.util;

import com.bjpn.workbench.bean.Activity;
import com.bjpn.workbench.mapper.ActivityMapper;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ProduceDataUtil {
    @Test
    public void test1(){
        ClassPathXmlApplicationContext beans = new ClassPathXmlApplicationContext("spring.xml");
        ActivityMapper activityMapper = beans.getBean(ActivityMapper.class);
        for (int i = 1; i <= 50; i++) {
            Activity activity = new Activity();
//            activity.setActivityOwner("1");
            activity.setActivityOwner("4");
//            activity.setActivityName("车展"+i);
            activity.setActivityName("派对"+i);
            activity.setActivityStartDate("2022-10-01");
            activity.setActivityEndDate("2022-10-05");
            activity.setActivityCost("1000000");
//            activity.setActivityDescription("办车展，结交客户，卖车");
            activity.setActivityDescription("开派对吸引潜在客户，卖车");
            activity.setCreateBy("1");
            activity.setCreateTime(DateToString.currentTimeToString());
            activityMapper.insert(activity);
        }
    }
}
